package com.demo.controller;

import com.demo.dao.HrmResourceMapper;
import com.demo.dto.HrmResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hrm")
public class HrmResourceController {

    @Autowired
    private HrmResourceMapper hrmResourceMapper;

    @RequestMapping("/add")
    public HrmResource add(@RequestBody @Validated HrmResource resource){
        hrmResourceMapper.add(resource);
        return resource;
    }
}
